package io.kiki.sba.registry.server.metadata.remoting.data;

import io.kiki.sba.registry.api.exchange.NodeExchanger;
import io.kiki.sba.registry.common.model.metaserver.nodes.DataStoreNode;
import io.kiki.sba.registry.server.metadata.lease.dataStoreNode.DataStoreNodeManager;
import io.kiki.sba.registry.server.metadata.remoting.DataNodeExchanger;
import io.kiki.sba.registry.server.metadata.remoting.connection.NodeConnectManager;
import io.kiki.sba.registry.server.metadata.remoting.notifier.AbstractNotifier;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;


@Component
public class DefaultDataServerService extends AbstractNotifier<DataStoreNode> implements DataServerService {

    @Autowired
    private DataNodeExchanger dataNodeExchanger;

    @Autowired
    private NodeConnectManager dataConnectionManager;

    @Autowired
    private DataStoreNodeManager dataStoreNodeManager;

    @Override
    protected NodeExchanger getNodeExchanger() {
        return dataNodeExchanger;
    }

    @Override
    protected List<DataStoreNode> getDataStoreNodeList() {
        return dataStoreNodeManager.getDataStoreNodeInfo().getList();
    }

    @Override
    protected NodeConnectManager getNodeConnectManager() {
        return dataConnectionManager;
    }


}
